#include <stdio.h>

#define N 10

int main(void) {
    int i, x;
    int a[N] = {1, 45, 18, 7, 22, 11, 33, 15, 27, 19};
    printf("Enter a number: ");
    scanf("%d", &x);

    for (i = 0; i < N; i++) {
        if (a[i] == x) //若找到, 提前循环
            break;
    }
    if (i < N)  //若循环提前结束，说明找到x，输出下标i
        printf("Index is %d\n", i);
    else
        printf("Not Found\n");
    return 0;
}
